#ifndef __SYLAR_UTIL_H__
#define __SYLAR_UTIL_H__

#include <cxxabi.h>
#include <pthread.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/syscall.h>
#include <stdio.h>
#include <stdint.h>
#include <vector>
#include <string>
#include <iomanip>
#include <execinfo.h>
#include <sys/time.h>
//#include <json/json.h>
#include <yaml-cpp/yaml.h>
#include <iostream>
#include <boost/lexical_cast.hpp>
#include "fiber.h"


namespace sylar{
    pid_t GetThreadId(); //获取线程id
    uint32_t GetFiberId(); //获取协程id
    void Backtrace(std::vector<std::string>& bt, int size, int skip = 1); //获取当前线程的调用栈
    std::string BacktraceToString(int size = 64, int skip = 2, const std::string& prefix=""); //把调用栈的信息转换为字符串
    /**
     * @brief 获取当前时间的毫秒
     */
    uint64_t GetCurrentMS();

    /**
     * @brief 获取当前时间的微秒
     */
    uint64_t GetCurrentUS();

}

#endif